#ifndef MKLISTENER_H
#define MKLISTENER_H

#pragma comment (lib, "dinput8.lib")

#include <d3d9.h>
#include <d3dx9.h>
#include <dinput.h>
#include <DxErr.h> 

//constants for mouse buttons (NEW)
#define DIMOUSE_LEFTBUTTON   0
#define DIMOUSE_RIGHTBUTTON  1
#define DIMOUSE_MIDDLEBUTTON 2

class mkListener
{

public:
	mkListener();
	~mkListener(void);
	void initDInput(HINSTANCE hInstance, HWND hWnd);
	void detect_input(void);
	void cleanDInput(void);
	DIMOUSESTATE getMouseState();
	BYTE* getKeyState();

protected:
	LPDIRECTINPUT8 din;    // ------------------ the pointer to the DirectInput interface
	LPDIRECTINPUTDEVICE8 dinkeyboard;    // ---- the pointer to the keyboard device
	LPDIRECTINPUTDEVICE8 dinmouse;    // ------- the pointer to the mouse device
	
	BYTE keystate[256];    // ------------------ the storage for the key-information
	DIMOUSESTATE mousestate;    // ------------- the storage for the mouse-information
	
};

#endif
